<?php
/*
 * php单例模式demo
 *
 * schopenhauerzhang@gmail.com
 *
 * */
class tree{
    public $handle=null;
    public function __construct()
    {
        $handle = null;
    }
    private   function  getTree()
    {
            self::$instance = new tree();
    }
    public static  function Dofunction()
    {
        if($handle==null)
        {
            $handle = "new getTree  "  ;
            return   $handle;
         }
        else
        {
            echo "already getTree ";
            return $handle;
        }
    }
 };
$tree = new tree();
var_dump($tree->Dofunction());
var_dump($new);
var_dump($tree->data);
/*
function sort_Up ( $arr )
{
    if( !is_array($arr)  )
    {
        //传进来不是数组就return  false;
        return  false;
    }
    for($i=0;$i<count($arr);$i++)
    {
        for($j=0;$j<count($arr)-1-$i;$j++)
        {
            if(  $arr[$j]> $arr[$j+1]  )
            {
                $temp = $arr[$j];
                $arr[$j] = $arr[$j + 1];
                $arr[$j + 1] = $temp;
            }
        }
    }
    return $arr;
}

var_dump(sort_Up ( [3,2,1] ));
*/

